import "./assets/main.css";
import "./assets/framework/font-awesome/css/font-awesome.min.css";
import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import axios from "axios";
import {getSessionStorage} from "./utils/common"
const app = createApp(App);
router.beforeEach(function (to, from, next) {
  let users = getSessionStorage("user");
  //除了登录、注册之外，都需要判断是否登录
  if (!(to.path == "/" || to.path == "/login" || to.path == "/register" || to.path == "/foundback")) {
    if (users == null) {
      router.push("/login");
    }
  }
  next();
});
app.use(createPinia());
app.use(router);

app.mount("#app");
